package teamGiga.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import teamGiga.bean.RequestBean;
import teamGiga.dao.MovieDao;
import action.servlet.ActionForWard;

public class ReqInfoAction extends Action{

	private String path;
	private boolean redirect;
	private int rno;

	public ReqInfoAction() {
		super();
	}

	public ReqInfoAction(String path, boolean redirect) {
		super();
		this.path = path;
		this.redirect = redirect;
	}

	@Override
	public ActionForWard execute(HttpServletRequest request,
			HttpServletResponse response) {
		// TODO Auto-generated method stub
		
		rno=Integer.parseInt(request.getParameter("no"));
		
		try {
			RequestBean bean=new RequestBean();
			
			bean=MovieDao.reqInfo(rno);
			MovieDao.reqHit(rno);
			request.setAttribute("reqInfo", bean);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		return new ActionForWard(path, redirect);
	}
	

}
